package Entity;

import java.io.Serializable;
import java.util.Date;


public class RequestStatusHistory implements Serializable 
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int historyId;
	private Status status;
	private Date startDate;
	private Date dueDate;
	private Date finishDate;
	private String comment;
	private Report details;
	private int nextHistory;
	private int prevHistory;
	
	/**
	 * 
	 * @return
	 */
	public int getNextHistory() {
		return nextHistory;
	}
/**
 * 
 * @param nextHistory
 */
	public void setNextHistory(int nextHistory) {
		this.nextHistory = nextHistory;
	}
/**
 * 
 * @return
 */
	public int getPrevHistory() {
		return prevHistory;
	}
/**
 * 
 * @param prevHistory
 */
	public void setPrevHistory(int prevHistory) {
		this.prevHistory = prevHistory;
	}
/**
 * 
 * @return
 */
	public int getHistoryId() {
		return historyId;
	}
/**
 * 
 * @param historyId
 */
	public void setHistoryId(int historyId) {
		this.historyId = historyId;
	}
/**
 * 
 * @return
 */
	public Status getStatus() {
		return status;
	}
/**
 * 
 * @param status
 */
	public void setStatus(Status status) {
		this.status = status;
	}
/**
 * 
 * @return
 */
	public Date getStartDate() {
		return startDate;
	}
/**
 * 
 * @param startDate
 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
/**
 * 
 * @return
 */
	public Date getDueDate() {
		return dueDate;
	}
/**
 * 
 * @param dueDate
 */
	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}
/**
 * 
 * @return
 */
	public Date getFinishDate() {
		return finishDate;
	}
/**
 * 
 * @param finishDate
 */
	public void setFinishDate(Date finishDate) {
		this.finishDate = finishDate;
	}
/**
 * 
 * @return
 */
	public String getComment() {
		return comment;
	}
/**
 * 
 * @param comment
 */
	public void setComment(String comment) {
		this.comment = comment;
	}
/**
 * 
 * @return
 */
	public Report getDetails() {
		return details;
	}
/**
 * 
 * @param details
 */
	public void setDetails(Report details) {
		this.details = details;
	}

	//return the time for the Step

	/**
	 * cosntructor light
	 * @param id
	 * @param status
	 * @param startDate
	 * @param dueDate
	 * @param finishDate
	 * @param comment
	 * @param details
	 */
	public RequestStatusHistory(int id,Status status, Date startDate, 
			Date dueDate,Date finishDate, String comment, Report details) {
		super();
		this.historyId =id;
		this.status = status;
		this.startDate = startDate;
		this.dueDate = dueDate;
		this.finishDate = finishDate;
		this.comment = comment;
		this.details = details;
	}
	/**
	 * constructor
	 * @param historyId
	 * @param status
	 * @param startDate
	 * @param dueDate
	 * @param finishDate
	 * @param comment
	 * @param details
	 * @param prevHistory
	 * @param nextHistory
	 */
	public RequestStatusHistory(int historyId, Status status, Date startDate, Date dueDate, Date finishDate, String comment, Report details, int prevHistory, int nextHistory) 
	{
		this.historyId =historyId;
		this.status = status;
		this.startDate = startDate;
		this.dueDate = dueDate;
		this.finishDate = finishDate;
		this.comment = comment;
		this.details = details;
		this.nextHistory = nextHistory;
		this.prevHistory = prevHistory;
		
	}
	/**
	 * data to string array to represent in table
	 * @return
	 */
	public String[] dataToStringArray() 
	{
		String historyId = this.historyId+"" ;
		String mainstatus = (this.status==null)? null: this.status.getmStatus().toString();
		String stepstatus = (this.status==null)? null: this.status.getsStatus().toString();
		String startDate = (this.startDate==null)? null: this.startDate.toString();
		String dueDate = (this.dueDate==null)? null: this.dueDate.toString();
		String finishDate = (this.finishDate==null)? null: this.finishDate.toString();
		String comment = this.comment;
	
		
		return new String[]{historyId,
				mainstatus,
				stepstatus,
	    		  	startDate,
	    		  	dueDate,
	    		  	finishDate,
	    		  	comment};      
	}
	/**
	 * 
	 * @return array string
	 */
	public String[] indexStringArray() 
	{
	      return new String[]{"History Id",
	    		  "Main Status",
	    		  "Step Status",
	    		  "Start Date",
	    		  "Due Date",
	    		  "End Date",
	    		  "comment"};      
	}
}
